<%@page import="entity.Visitor"%>
<%@page import="entity.Tour"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
    Visitor visitor = null;
    try{    	
    	visitor = (Visitor)session.getAttribute("curSession");
    }catch(Exception ex){
        System.out.println(" home page says: " + ex.getMessage());
    }
%>	
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Add new tour</title>
<link href="css/java_tech_css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.9.0.js"></script>
<script type="text/javascript" src="js/jquery.validate.min.js"></script>
<script type="text/javascript" src="js/messages_vi.js"></script>
<script type="text/javascript">
    function showDetail(val) {
		$("#tourID").val(val);
		$("#viewTour").submit();
	}
</script>
</head>
<body>
	<div id="container">
		<div class="visitor-info-view">
			<h3>Search Tour</h3>
			<div class="firstname-search">
				<form action="searchTour" method="post">
					<div class="firstname-title">
						<p>Tour Tag:</p>
					</div>
					<div class="firstname-input">
						<input type="text" name="name_search">
					</div>
					<div>
						<input type="submit" value="Search" /> <span>(Type Tour tag
							name Visitor and Click Search button)</span>
					</div>
				</form>
			</div>
		</div>
		<div class="content1">
			<div class="table">
				<div class="row1">
					<div class="firstname">
						<p>Tour Name</p>
					</div>
					<div class="lastname">
						<p>Places</p>
					</div>
					<div class="gender">
						<p>Start Date</p>
					</div>
					<div class="telephone">
						<p>End Date</p>
					</div>
					<div class="youin">
						<p>Price</p>
					</div>
					<div class="hobbies">
						<p>Max Visitors</p>
					</div>
					<div class="description">
						<p>Current Visitor(s)</p>
					</div>
				</div>
				<div class="clear"></div>
				
				<form name="viewTour" action="viewtourdetail" id="viewTour" method="post">
					<input name="tourID" id="tourID" style="display: none">
					<s:iterator value="list" var="i">				
						<div class="row2">
							<div class="firstname">
								<p>
								<a href="javascript:viewdetail" onclick="showDetail(${i.id})">
								<s:property value="%{tourName}"/> </a>
								</p>
							</div>
							<div class="lastname">
								<p>
									<s:property value="places" />
								</p>
							</div>
							<div class="gender">
								<p>
									<s:property value="startDate" />
								</p>
							</div>
							<div class="telephone">
								<p>
									<s:property value="endDate" />
								</p>
							</div>
							<div class="youin">
								<p>
									<s:property value="price" />
								</p>
							</div>
							<div class="hobbies">
								<p>
									<s:property value="maxVisitors" />
								</p>
							</div>
							<div class="description">
								<p>
									<s:property value="currentVisitors" />
								</p>
							</div>
						</div>
					</s:iterator>
				</form>
			</div>
		</div>
	</div>
</body>
</html>